"use strict";
cc._RF.push(module, '72d03Hz5f9FoZD0Ppln3ECv', 'fruit');
// scripts/fruit.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var NewClass = /** @class */ (function (_super) {
    __extends(NewClass, _super);
    function NewClass() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.fruit_body = null;
        // 爆炸音效
        _this.music_boom = null;
        // 水音效
        _this.music_water = null;
        // 碰撞音效
        _this.music_knock = null;
        return _this;
    }
    NewClass.prototype.drop = function () {
        this.fruit_body.gravityScale = 1;
        this.fruit_body.linearVelocity = cc.v2(10, -480);
    };
    NewClass.prototype.onLoad = function () {
    };
    NewClass.prototype.onBeginContact = function (contact, self, other) {
        // 播放碰撞声音
        cc.audioEngine.play(this.music_knock, false, 1);
        if (self.node._name == other.node._name) {
            self.node.emit('sameContact', { self: self, other: other });
            // 播放碰撞声音
            cc.audioEngine.play(this.music_water, false, 1);
        }
    };
    // 结束碰撞
    NewClass.prototype.onEndContact = function () {
    };
    // 持续碰撞，接触时被调用
    NewClass.prototype.onPreSolve = function () {
    };
    // 碰撞接触更新完后调用，可以获得冲量信息
    NewClass.prototype.onPostSolve = function () {
    };
    __decorate([
        property(cc.RigidBody)
    ], NewClass.prototype, "fruit_body", void 0);
    __decorate([
        property(cc.AudioClip)
    ], NewClass.prototype, "music_boom", void 0);
    __decorate([
        property(cc.AudioClip)
    ], NewClass.prototype, "music_water", void 0);
    __decorate([
        property(cc.AudioClip)
    ], NewClass.prototype, "music_knock", void 0);
    NewClass = __decorate([
        ccclass
    ], NewClass);
    return NewClass;
}(cc.Component));
exports.default = NewClass;

cc._RF.pop();